<?php
	$root = "http://".$_SERVER['HTTP_HOST']."/".substr($_SERVER['PHP_SELF'], 1, strpos(substr($_SERVER['PHP_SELF'], 1), "/"))."/";
?>
<!DOCTYPE html>
<!-- 
文件用途:列表综合模板展示
作者:hjl
制作日期:2012-11-22
最后编辑人:hjl
最后编辑时间:2012-11-26
-->
<html lang="en">
  <head>
    <title>列表</title>
    <base href="<?php echo $root;?>">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0"> 
    <?php include '../pages/common/importBaseCss.php'; ?>
	<script type="text/javascript">
	var aclData= {available:"true",read:"true",edit:"true",del:"true",add:"true",print:"true"}
	var breadCrumbDatas = [{"id":1,href:"index.jsp",clazz:'icon-home'},
			{id:2,text:'例子',href:'pages/example/index.jsp'},
			{id:3,text:'列表'}
		   ];
	var tabDatas = [{id:1,href:"#tab_new",iClass:"splashy-document_letter_edit",text:"新记录"},
			{id:2,href:"#tab_list",liClass:"active",iClass:"splashy-view_list",text:"列表"},
			{id:3,href:"",iClass:"splashy-marker_rounded_red",text:"实时数据(暂无)"},
			{id:3,href:"",iClass:"splashy-image_cultured",text:"报表(暂无)"}
		   ];
	var dynamicFormDatas = {
		   departmentDatas:[{value:1,display:"部门1"},
			{value:2,display:"部门2"},
			{value:3,display:"部门3"},
			{value:4,display:"部门4"}
		   ],
		   mineDatas:[{value:1,display:"矿井1"},
			{value:2,display:"矿井2"},
			{value:3,display:"矿井3"},
			{value:4,display:"矿井4"}
		   ],
		   roleDatas:[{value:1,display:"角色1"},
			{value:2,display:"角色2"},
			{value:3,display:"角色3"},
			{value:4,display:"角色4"}
		   ],
		   dataTypeDatas:[{value:"数据类型1",display:"数据类型1"},
			{value:"数据类型1",display:"数据类型2"},
			{value:"数据类型1",display:"数据类型3"},
			{value:"数据类型1",display:"数据类型4"}
		   ],
		   sensorCategoryDatas:[{value:"传感器类别1",display:"传感器类别1"},
			{value:"传感器类别2",display:"传感器类别2"},
			{value:"传感器类别3",display:"传感器类别3"},
			{value:"传感器类别4",display:"传感器类别4"}
		   ],
		   userDatas:[{id:1,display:"矿井1",pid:0},
		   	{id:2,value:"00001",display:"工程师:员工1",pid:1},
		   	{id:3,value:"00002",display:"监控员:员工2",pid:1},
		   	{id:4,display:"矿井2",pid:0},
		   	{id:5,value:"00003",display:"工程师:员工3",pid:4},
		   	{id:6,value:"00004",display:"监控员:员工4",pid:4},
		   	{id:7,display:"矿井3",pid:0},
		   	{id:8,value:"00005",display:"工程师:员工5",pid:7},
		   	{id:9,value:"00006",display:"监控员:员工6",pid:7},		   			   	
		   ]};	   
	</script>
    </head>
    <body>
		<div id="loading_layer" style="display:none"><img src="img/ajax_loader.gif" alt="" /></div>
		<!-- style switcher -->
		<div class="style_switcher">
		</div>
		
		<div id="maincontainer" class="clearfix">
			<!-- header -->
            <header>
                <div class="navbar navbar-fixed-top">
                    <div class="navbar-inner">
                    </div>
                </div>
            </header>
            <!-- main content -->
            <div id="contentwrapper">
                <div class="main_content">
                    <!-- breadCrumb -->
                    <nav>
                        <div id="jCrumbs" class="breadCrumb module">
                        </div>
                    </nav>
                    <div class="row-fluid">
						<div class="span12">
							<div class="mbox">
								<div class="tabbable">
									<!--nav tabs  -->
									<div class="heading" >
										<ul class="nav nav-tabs" id="mainTabs">
										</ul>
									</div>
									<!--content tabs  -->
									<div class="tab-content">
										<!--tab tab_new  -->
										<div class="tab-pane" id="tab_new">
											<!-- 数据增加开始{ -->
											<div class="row-fluid">
												<div class="span12">
													<h3 class="heading">这是主标题<small>(这是说明)</small></h3>
												</div>
											</div>
											<div class="row-fluid">
												<div class="span12">
													<form id="addForm">
														<div class="row-fluid">
															<div class="span6">
																<div class="row-fluid">
																	<div class="span12">
																		<h4 class="heading">这是次标题<small>(这是说明)</small></h4>
																	</div>
																</div>
																<div class="formSep">
																	<div class="row-fluid">
																		<div class="span12">
																			<label for="username">用户名<span class="f_req">*</span></label>
																			<input type="text" id="username" name="username" class="span8" placeholder="这是占位符"/>
																			<span class="help-block">这是更详细的说明</span>
																		</div>
																	</div>
																	<div class="row-fluid">
																		<div class="span12">
																			<label for="workno">工号<span class="f_req">*</span></label>
																			<input type="text" id="workno" name="workno" class="span8" placeholder="这是占位符"/>
																			<span class="help-block">从服务器段验证唯一性</span>
																		</div>
																	</div>																
																	<div class="row-fluid">
																		<div class="span12">
																			<label for="password">密码 <span class="f_req">*</span></label>
																			<input type="password" id="password" name="password" class="span8 valid" placeholder="这是占位符"/>
																		</div>
																	</div>
																	<div class="row-fluid">
																		<div class="span12">
																			<label for="repassword">重复密码<span class="f_req">*</span></label>
																			<input type="password" id="repassword" name="repassword" class="span8 valid" placeholder="请再次输入密码"/>
																		</div>
																	</div>																
																</div>
																<div class="formSep">
																	<div class="row-fluid">
																		<div class="span12">
																			<label for="message">信息<span class="f_req">*</span></label>
																			<textarea id="message" name="message" cols="10" rows="3" class="span8" placeholder="这是占位符"></textarea>
																		</div>
																	</div>
																</div>
															</div>
															<div class="span6">
																<div class="row-fluid">
																	<div class="span12">
																		<h4 class="heading">这是次标题<small>(这是说明)</small></h4>
																	</div>
																</div>
																<div class="formSep">
																	<div class="row-fluid">
																		<div class="span12">
																			<label for="age">年龄<span class="f_req">*</span></label>
																			<input type="text" id="age" name="age" class="span8" placeholder="这是占位符"/>
																		</div>
																	</div>
																	<div class="row-fluid">	
																		<div class="span12">
																			<label for="gender">性别</label>
																			<label class="checkbox inline"> <input type="radio" id="gender" name="gender" value="male" checked="checked"> 男 </label>
																			<label class="checkbox inline"> <input type="radio" id="gender" name="gender" value="female"> 女 </label>
																		</div>
																	</div>
																</div>
																<div class="formSep">
																	<div class="row-fluid">
																		<div class="span12">
																			<label for="email">Email<span class="f_req">*</span></label>
																			<input type="text" id="email" name="email" class="span8" placeholder="这是占位符"/>
																		</div>
																	</div>
																	<div class="row-fluid">
																		<div class="span12">
																			<label for="ipAddress">ip地址<span class="f_req">*</span></label>
																			<input type="text" id="ipAddress" name="ipAddress" class="span8" placeholder="这是占位符"/>
																		</div>
																	</div>																
																	<div class="row-fluid">	
																		<div class="span12">
																			<label for="tel">电话</label>
																			<input type="text" id="tel" name="tel" class="span8" placeholder="这是占位符"/>
																		</div>
																	</div>
																	<div class="row-fluid">	
																		<div class="span12">
																			<label for="url">博客</label>
																			<input type="text" id="url" name="url" class="span8" placeholder="这是占位符"/>
																		</div>
																	</div>																
																</div>
																<div class="formSep">
																	<div class="row-fluid">
																		<div class="span12">
																			<label for="department">部门<span class="f_req">*</span></label>
																			<select class="input-xlarge" id="department" name="department"></select>
																		</div>
																	</div>
																	<div class="row-fluid">	
																		<div class="span12">
																			<label for="tel">矿井</label>
																			<select class="input-xlarge" id="mine" name="mine"></select>
																		</div>
																	</div>
																	<div class="row-fluid">	
																		<div class="span12">
																			<label for="url">角色</label>
																			<select class="input-xlarge" id="role" name="role"></select>
																		</div>
																	</div>
																	<div class="row-fluid">	
																		<div class="span12">
																			<label for="url">数据类型</label>
																			<select class="input-xlarge" id="dataType" name="dataType"></select>
																		</div>
																	</div>
																	<div class="row-fluid">	
																		<div class="span12">
																			<label for="url">人员选择</label>
																			<select multiple="multiple" name="users" class="multiselect" id="optgroup"></select>
																		</div>
																	</div>																																	
																</div>
															</div>
														</div>	
														<div class="row-fluid">
															<div class="formSep">
																<div class="row-fluid">
																	<div class="span12">
																		<label for="interest"><span class="error_placement">兴趣</span> <span class="f_req">*</span></label>
                                										<label class="checkbox inline"> 
                                											<input type="checkbox" id="interest" name="interest" value="sport"> 运动
                                										</label>
                                										<label class="checkbox inline"> 
                                												<input type="checkbox" id="interest" name="interest" value="movie"> 电影 
                                										</label>
                                										<label class="checkbox inline"> 
                                											<input type="checkbox" id="interest" name="interest" value="game"> 游戏
                                										</label>
                                										<label class="checkbox inline"> 
                                											<input type="checkbox" id="interest" name="interest" value="other"> 其他
                                										</label>
																	</div>
																</div>
															</div>
														</div>	
														<div class="row-fluid">	
															<div class="span6">
																<label for="locale"><span class="error_placement">所在城市</span> <span class="f_req">*</span></label>
                                								<select class="input-xlarge" id="locale" name="locale">
                                									<option value="">请选择</option>
                                    								<option value="beijing">北京</option>
                                    								<option value="shanghai">上海</option>
                                    								<option value="guangzhou">广州</option>
                                    								<option value="shenzhen">深圳</option>
                                    								<option value="othercity">其他城市</option>
                                								</select>
															</div>
															<div class="span6">
																<label for="date"><span class="error_placement">日期</span> <span class="f_req">*</span></label>
																<input type="text" id="date" name="date" class="span8" placeholder="这是占位符"/>
															</div>															
														</div>
														<div class="row-fluid">
															<div class="form-actions">
																<input class="btn btn-gebo" type="submit" value="提交"></input>
																<input class="btn" type="reset" value="重置"></input>
															</div>
														</div>	
													<!-- }数据增加结束 -->
													</form>													
												</div>
											</div>
										</div>
										
										<!--tab tab_list  -->
										<div class="tab-pane active" id="tab_list">
											<table data-msg_rowlink="a" class="table table_vam mbox_table dTableR" id="dt_tab_list">
												<thead>
													<tr>
													<!-- 列表表头开始{ -->
													   <th  class="table_checkbox"><input type="checkbox" data-tableid="dt_tab_list" class="select_msgs" name="select_msgs"></th>
                                                       <th>序号</th>
                                                       <th>id</th>
                                                       <th>用户名</th>
                                                       <th>密码</th>
                                                       <th>工号</th>
                                                       <th>信息</th>
                                                       <th>年龄</th>
                                                       <th>性别</th>	
                                                       <th>Email</th>
                                                       <th>电话</th>
                                                       <th>博客</th>
                                                       <th>兴趣</th>
                                                       <th>所在城市</th>
                                                       <th>日期</th>
                                                    <!-- }列表表头结束 -->   
													</tr>
												</thead>
												<tbody>
												</tbody>
											</table>	
										</div>
										
										<!--tab tab_view  -->
										<div class="tab-pane" id="tab_view">
											<div class="sepH_b">
												<div class="row-fluid">
													<div class="span12">
														<a href="#tab_list" data-toggle="tab" class="btn"><i class="icon-chevron-left"></i>返回</a>
													</div>
												</div>
											</div>	
											<div class="doc_view" data-bind="attr:{'msg-id':id}">
												<!-- 数据详情开始{  -->
												<div class="doc_view_header">
 													<dl class="dl-horizontal">
														<dt>用户名</dt>
															<dd data-bind="text:username"></dd>
														<dt>密码</dt>
															<dd><span data-bind="text:password"></span></dd>
														<dt>工号</dt>
															<dd><span data-bind="text:workno"></span></dd>
														<dt>年龄</dt>
															<dd><span data-bind="text:age"></span></dd>
														<dt>性别</dt>
															<dd><span data-bind="text:gender()=='female'?'男':'女'"></span></dd>
														<dt>Email</dt>
															<dd><span data-bind="text:email"></span></dd>
														<dt>电话</dt>
															<dd><span data-bind="text:tel"></span></dd>
														<dt>博客</dt>
															<dd><span data-bind="text:url"></span></dd>
														<dt>兴趣</dt>
															<dd>
																<input type="checkbox" disabled="disabled" value="sport" data-bind="checked: interest" />运动
																<input type="checkbox" disabled="disabled" value="movie" data-bind="checked: interest" />电影
																<input type="checkbox" disabled="disabled" value="game" data-bind="checked: interest" />游戏
																<input type="checkbox" disabled="disabled" value="other" data-bind="checked: interest" />其他
															</dd>
														<dt>居住地点</dt>
															<dd data-bind="switch: locale">
																<span data-bind="case: 'beijing'">北京</span>
																<span data-bind="case: 'shanghai'">上海</span>
																<span data-bind="case: 'guangzhou'">广州</span>
																<span data-bind="case: 'shenzhen'">深圳</span>
																<span data-bind="case: 'othercity'">其他城市</span>
															</dd>
														<dt>日期</dt>
															<dd><span data-bind="text:date"></span></dd>								
													</dl>
												</div>
												<div class="doc_view_content" data-bind="text:message">
												</div>
												<!-- }数据详情结束  -->
												<div class="doc_view_footer clearfix">
													<div class="btn-group pull-left">
														<a class="btn" id="editBtn" href="#tab_edit"><i class="icon-pencil"></i> 编辑</a>
														<a class="btn" id="delteBtn" href="#"><i class="icon-trash"></i>删除</a>
													</div>
												</div>
											</div>
										</div>
										
										<!--tab tab_edit  -->
										<div class="tab-pane" id="tab_edit">
											<div class="sepH_b">
												<div class="row-fluid">
													<div class="span12">
														<a href="#tab_view" data-toggle="tab" class="btn"><i class="icon-chevron-left"></i>返回</a>
													</div>
												</div>
											</div>
											<div>
												<form id="editForm">
													<div class="row-fluid">
														<div class="span6">
															<!-- 数据编辑开始{  -->
															<div class="row-fluid">
																<div class="span12">
																	<h4 class="heading">这是次标题<small>(这是说明)</small></h4>
																</div>
															</div>
															<div class="formSep">
																<div class="row-fluid">
																	<div class="span12">
																		<label for="username">用户名<span class="f_req">*</span></label>
																		<input type="text" id="username" name="username" class="span8" data-bind="value: username, valueUpdate: 'afterkeydown'"/>
																		<span class="help-block">这是更详细的说明</span>
																	</div>
																</div>
																<div class="row-fluid">
																	<div class="span12">
																		<label for="workno">工号<span class="f_req">*</span></label>
																		<input type="text" id="workno" name="workno" class="span8" data-bind="value: workno, valueUpdate: 'afterkeydown'"/>
																		<span class="help-block">从服务器段验证唯一性</span>
																	</div>
																</div>																
																<div class="row-fluid">
																	<div class="span12">
																		<label for="password">密码 <span class="f_req">*</span></label>
																		<input type="password" id="password" name="password" class="span8 valid" data-bind="value: password, valueUpdate: 'afterkeydown'"/>
																	</div>
																</div>
																<div class="row-fluid">
																	<div class="span12">
																		<label for="repassword">重复密码<span class="f_req">*</span></label>
																		<input type="password" id="repassword" name="repassword" class="span8 valid" placeholder="请再次输入密码"/>
																	</div>
																</div>																
															</div>
															<div class="formSep">
																<div class="row-fluid">
																	<div class="span12">
																		<label for="message">信息<span class="f_req">*</span></label>
																		<textarea id="message" name="message" cols="10" rows="3" class="span8" data-bind="value: message, valueUpdate: 'afterkeydown'"></textarea>
																	</div>
																</div>
															</div>
														</div>
														<div class="span6">
															<div class="row-fluid">
																<div class="span12">
																	<h4 class="heading">这是次标题<small>(这是说明)</small></h4>
																</div>
															</div>
															<div class="formSep">
																<div class="row-fluid">
																	<div class="span12">
																		<label for="age">年龄<span class="f_req">*</span></label>
																		<input type="text" id="age" name="age" class="span8" data-bind="value: age, valueUpdate: 'afterkeydown'"/>
																	</div>
																</div>
																<div class="row-fluid">	
																	<div class="span12">
																		<label for="gender">性别</label>
																		<label class="checkbox inline"> <input type="radio" id="gender" name="gender" value="male" data-bind="checked: gender"> 男 </label>
																		<label class="checkbox inline"> <input type="radio" id="gender" name="gender" value="female" data-bind="checked: gender"> 女 </label>
																	</div>
																</div>
															</div>
															<div class="formSep">
																<div class="row-fluid">
																	<div class="span12">
																		<label for="email">Email<span class="f_req">*</span></label>
																		<input type="text" id="email" name="email" class="span8" data-bind="value: email, valueUpdate: 'afterkeydown'"/>
																	</div>
																</div>
																<div class="row-fluid">	
																	<div class="span12">
																		<label for="tel">电话</label>
																		<input type="text" id="tel" name="tel" class="span8" data-bind="value: tel, valueUpdate: 'afterkeydown'"/>
																	</div>
																</div>
																<div class="row-fluid">	
																	<div class="span12">
																		<label for="url">博客</label>
																		<input type="text" id="url" name="url" class="span8" data-bind="value: url, valueUpdate: 'afterkeydown'"/>
																	</div>
																</div>																
															</div>
															<div class="formSep">
																<div class="row-fluid">
																	<div class="span12">
																		<label for="department">部门<span class="f_req">*</span></label>
																		<select class="input-xlarge" id="department" name="department"
																			data-bind="options:departmentDatas,optionsCaption: '请选择',value:department,
                                											optionsText: 'display',optionsValue: 'value'",></select>
																	</div>
																</div>
																<div class="row-fluid">	
																	<div class="span12">
																		<label for="tel">矿井</label>
																		<select class="input-xlarge" id="mine" name="mine"
																			data-bind="options:mineDatas,optionsCaption: '请选择',value:mine,
                                											optionsText: 'display',optionsValue: 'value'"></select>
																	</div>
																</div>
																<div class="row-fluid">	
																	<div class="span12">
																		<label for="url">角色</label>
																		<select class="input-xlarge" id="role" name="role"
																			data-bind="options:roleDatas,optionsCaption: '请选择',value:role,
                                											optionsText: 'display',optionsValue: 'value'"></select>
																	</div>
																</div>																
															</div>
														</div>
													</div>
													<div class="row-fluid">
														<div class="formSep">
															<div class="row-fluid">
																<div class="span12">
																	<label for="interest"><span class="error_placement">兴趣</span> <span class="f_req">*</span></label>
                                									<label class="checkbox inline"> 
                                										<input type="checkbox" id="interest" name="interest" value="sport" data-bind="checked :interest"> 运动
                                									</label>
                                									<label class="checkbox inline"> 
                                										<input type="checkbox" id="interest" name="interest" value="movie" data-bind="checked :interest"> 电影 
                                									</label>
                                									<label class="checkbox inline"> 
                                										<input type="checkbox" id="interest" name="interest" value="game" data-bind="checked :interest"> 游戏
                                									</label>
                                									<label class="checkbox inline"> 
                                										<input type="checkbox" id="interest" name="interest" value="other" data-bind="checked :interest"> 其他
                                									</label>
																</div>
															</div>
														</div>
													</div>	
													<div class="row-fluid">	
														<div class="span6">
															<label for="locale"><span class="error_placement">所在城市</span> <span class="f_req">*</span></label>
                                							<select class="input-xlarge" id="locale" name="locale" 
                                								data-bind="options:localeDatas,optionsCaption: '请选择',value:locale,
                                								optionsText: 'display',optionsValue: 'value'",>
                                							</select>
														</div>
														<div class="span6">
															<label for="date"><span class="error_placement">日期</span> <span class="f_req">*</span></label>
															<input type="text" id="date" name="date" class="span8" data-bind="value: date, valueUpdate: 'afterkeydown'"/>
														</div>
													</div>
													<!-- }数据编辑结束  -->
													<div class="row-fluid">
														<div class="form-actions">
															<input id="id" name="id" type="hidden" data-bind="value: id"></input>
															<input class="btn btn-gebo" type="submit" value="提交"></input>
															<input class="btn" type="reset" value="重置"></input>
														</div>
													</div>	
												</form>		
											</div>
										</div>
										
									</div>
								</div>
							</div>
							
						</div>
					</div>
					
					<!-- hide elements -->
					<div class="hide">
					   <!-- searchs for list -->
					   	<form class="dt_tab_list_searchs">
					   		<label for="department">部门:<span class="f_req">*</span>
								<select class="input-small" id="department" name="department"></select>					   		
					   		</label>
					    	<label class="checkbox" for="search_username">用户名:<span class="f_req">*</span>
    							<input type="text" id="search_username" class="input-mini" search-index="3" placeholder="用户名"/>
  							</label>
  							<label for="search_startDate">开始-日期:
  								<div class="input-append date" id="dp_start">
									<input class="input-small" type="text" readonly="readonly" id="search_startDate" name="search_startDate"/><span class="add-on"><i class="splashy-calendar_day_up"></i></span>
								</div>
  							</label>
  							<label class="checkbox" for="search_startTime">时间:
								<input type="text" class="input-mini" id="search_startTime" name="search_startTime"/>
							</label>
  							<label for="search_endDate">结束-日期:
  								<div class="input-append date" id="dp_end">
									<input class="input-small" type="text" readonly="readonly" id="search_endDate" name="search_endDate"/><span class="add-on"><i class="splashy-calendar_day_down"></i></span>
								</div>
  							</label>
  							<label class="checkbox" for="search_endTime">时间:
								<input type="text" class="input-mini" id="search_endTime" name="search_endTime"/>
							</label>
  							<label class="checkbox" for="search_gender">性别:
  								<select class="input-small" id="search_gender" search-index="6">
									<option value="">请选择</option>
									<option value="female">女</option>
									<option value="male">男</option>
								</select>
							</label>
							<label for="search_date">日期:
  								<div class="input-append date" id="dp_date">
									<input class="input-small" type="text" id="search_date" name="search_date" readonly="readonly"/><span class="add-on"><i class="splashy-calendar_day"></i></span>
								</div>
  							</label> 
							<label class="checkbox" for="search_time">时间:
								<input type="text" class="input-small" id="search_time" name="search_time"/>
							</label>
							<input type="hidden" id="search_rangeDate" name="search_rangeDate" search-index="4"/> 
							<input type="hidden" id="search_dateTime" name="search_dateTime" search-index="7"/> 					
  							<a class="btn">搜索</a>
						</form>					
						<!-- actions for list -->
						<div class="dt_tab_list_actions">
							<div class="btn-group">
								<a href="#" class="delete_msg btn" title="删除" data-tableid="dt_tab_list"><i class="icon-trash"></i></a>
								<a href="#" class="show_all_msg btn" title="显示全部"><i class="icon-repeat"></i></a>
								<a href="#" class="print btn" title="打印"><i class="icon-print"></i></a>
							</div>
						</div>
						<!-- confirmation -->
						<div id="confirm_dialog" class="cbox_content">
							<div class="sepH_c tac"><strong>确定删除选中的记录?</strong></div>
							<div class="tac">
								<a href="#" class="btn btn-gebo confirm_yes">是</a>
								<a href="#" class="btn confirm_no">否</a>
							</div>
						</div>
					</div>
					
                </div>
            </div>
            
			<!-- sidebar -->
            <a href="javascript:void(0)" class="sidebar_switch on_switch ttip_r" title="隐藏侧边栏">侧边栏</a>
            <div class="sidebar" id="sidebar">
			</div>
		</div>
		<?php include '../pages/common/importBaseJs.php'; ?>
		<!-- app.js 
		<script src="js/app/example/listbox.js"></script>
		-->
<script type="text/javascript">
	/*
	*文件用途:列表综合模板展示
	*作者:hjl
	*制作日期:2012-11-22
	*最后编辑人:hjl
	*最后编辑时间:2012-11-28
	*/	
	//================
	//模块入口
	//================
    $(document).ready(function() {
    	if("undefined" != typeof aclData){
        	if("undefined" != typeof dynamicFormDatas){
				app.buildDynamicForm(dynamicFormDatas);			
			}    	
        	app.list();
        	app.regAdd();
        	app.regEdit();
			app.actions();
			app.aclManage(aclData);
		}else{
			smoke.alert('对不起,权限信息丢失',{ok:"关闭"},function(e){
				window.location.href = "index.jsp";
			});
		}
    });
    app = {
    	//列表数据
        oTable: {},
        //选中数据id值
        selectedIds: new TAFFY(),
        //保存每页开始的记录数_iDisplayStart
        selfIDisplayStart: 0,        
		//================
		//列表操作
		//================    
        list: function() {
            var tableList = $('#dt_tab_list');
            //DataTable config
            var oTable = tableList.dataTable({
				"oLanguage": {
					"sUrl": "js/config/datatables/cn_oLanguage.txt",
				},
				"sDom": "<'row'<'span6'<'dt_actions'>l><'span6'>r><'row'<'dt_searchs'>>t<'row'<'span6'i><'span6'p>>",
                "sPaginationType": "bootstrap",
                "iDisplayLength": 25,
                "sEcho":1,
                "asSorting": [[]],
                "bServerSide": true,
                "bProcessing": true,
                "bStateSave": true,
                "sAjaxSource": "json/listbox/list.json",
				"aoColumnDefs": [
                    { "mData": function ( source, type, val ) {return "";},	
      				  "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                      		var isFind = app.selectedIds({id:oData.id.toString()}).first();
							if (isFind) {
								$(nTd).addClass("nohref").html("<input type='checkbox' class='select_msg' name='msg_sel' checked='checked'>");
							} else {
								$(nTd).addClass("nohref").html("<input type='checkbox' class='select_msg' name='msg_sel'>");
							}
                      },
  				      "fnRender": function ( o ) {
                    		app.selfIDisplayStart = o.oSettings._iDisplayStart;
                      },
					   "bSortable": false,"aTargets": [0] 
					},
                    { "mData": function ( source, type, val ) {return "";},	
      				  "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
      				  		$(nTd).addClass("nohref").text(app.selfIDisplayStart + iRow + 1);
                      },
					  "bSortable": false,"aTargets": [1] 
					},			
					{ "mData": "id","bSearchable": false,"aTargets": [2],"bVisible": false},
					{ "mData": "username",
      				  "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
      				     	$(nTd).attr("msg_id",oData.id);
      				  		$(nTd).html("<a href='#tab_view'>"+sData+"</a>");
                       }, 
					  "sName": "username","aTargets": [3] 
					},
					{ "mData": "password","sName": "password","bSearchable": false,"aTargets": [4],"bVisible": false},
                    { "mData": "workno","sName": "workno","aTargets": [5] },
                    { "mData": "message","sName": "message","aTargets": [6],"bVisible": false},
                    { "mData": "age","sName": "age","aTargets": [7],"bVisible": false},
                    { "mData": "gender","sName": "gender","aTargets": [8],
                      "mRender": function ( data, type, full ) {
                      	if(data=="female"){
                      		return "女";
                      	}else
                      	if(data="male"){
                      		return "男";
                      	}
                      }
                    },
                    { "mData": "email","sName": "email","aTargets": [9]},
                    { "mData": "tel","sName": "tel","aTargets": [10]},
                    { "mData": "url","sName": "url", "aTargets": [11]},
                    { "mData": "interest","sName": "interest", "aTargets": [12],
                      "mRender": function ( data, type, full ) {
						var returnValue = [];
						for(index in data){
							if(data[index]=="sport"){
								returnValue[index]="运动";
							}else
							if(data[index]=="game"){
								returnValue[index]="游戏";
							}else
							if(data[index]=="movie"){
								returnValue[index]="电影";
							}else
							if(data[index]=="other"){
								returnValue[index]="其他";
							}
						}
						return returnValue;
                      }                    
                    },
                    { "mData": "locale","sName": "locale", "aTargets": [13]},
                    { "mData": "date","sName": "date", "aTargets": [14]}
				],
				"fnDrawCallback": function( oSettings ) {
      				app.rowLink();
      				//* copy actions buttons to datatable
      				$('#dt_tab_list_wrapper .dt_actions').html($('.dt_tab_list_actions').html());
      				//* build style and datas of searchs
      				app.buildListSearchs(oSettings);
      				//* add tootlips for buttons
      				$('#dt_tab_list_wrapper .dt_actions a').addClass('ttip_t');
      				//* reinitialize tooltips
      				gebo_tips.init();
    			}
            });
            app.oTable = oTable;
        },
		//================
		//其他操作
		//================        
		actions: function() {
		    //列表-当前页全选操作
			$('.table').on('click', '.select_msgs', function () {
				var tableid = $(this).data('tableid');
				$('#'+tableid).find('input[name=msg_sel]').attr('checked', this.checked).closest('tr').addClass('rowChecked')
				if($(this).is(':checked')) {
					$('#'+tableid).find('input[name=msg_sel]').closest('tr').addClass('rowChecked')
				} else {
					$('#'+tableid).find('input[name=msg_sel]').closest('tr').removeClass('rowChecked')
				}
			});
			//列表-行选择
			$('input[name=msg_sel]').live('click',function() {
				var id = $(this).closest('tr').find("td[msg_id]").attr("msg_id");
				if($(this).is(':checked')) {
					app.selectedIds.insert({"id":id});
					$(this).closest('tr').addClass('rowChecked');
				} else {
					app.selectedIds({"id":id}).remove();
					$(this).closest('tr').removeClass('rowChecked');
				}
			});
            //列表-删除操作
			$(".dt_actions .delete_msg").live('click',function (e) {
				e.preventDefault();
	        	var postData = {};
	        	postData.ids = app.selectedIds().select("id").toString();
	        	if (postData.ids != "") {
	        		$.colorbox({
                        initialHeight: '0',
                        initialWidth: '0',
                        href: "#confirm_dialog",
                        inline: true,
                        opacity: '0.3',
                        onComplete: function(){
                            $('.confirm_yes').click(function(e){
                                e.preventDefault();
                                app.del(postData);
                                $.colorbox.close();
                            });
                            $('.confirm_no').click(function(e){
                                e.preventDefault();
                                $.colorbox.close(); 
                            });
                        }
                   });     
	        		
	        	} else {
	        		$.sticky("请选择记录进行删除。", {autoclose : 5000, position: "top-center", type: "st-info" });
	        	}
			});
			//列表-显示全部操作
			$(".dt_actions .show_all_msg").live('click',function (e) {
				e.preventDefault();
            	var oSettings = app.oTable.fnSettings();
            	for(iCol = 0; iCol < oSettings.aoPreSearchCols.length; iCol++) {
                    oSettings.aoPreSearchCols[ iCol ].sSearch = '';
                }
            	oSettings.selfRetrunZeroPage = true;
            	app.oTable.fnDraw(oSettings);
            	
            	$(".dt_searchs input").val("");
            	$(".dt_searchs select option:selected").removeAttr("selected");
            	$(".dt_searchs select option:first").attr("selected","selected");
			});
			//列表-打印操作
			$(".dt_actions .print").live('click',function (e) {
				e.preventDefault();
            	var oSettings = app.oTable.fnSettings();
            	var postData ={};
            	if(oSettings._iRecordsDisplay>0){
                	postData.iDisplayLength = oSettings._iDisplayLength;
                	postData.iDisplayStart = oSettings._iDisplayStart;
                	postData.iRecordsDisplay = oSettings._iRecordsDisplay;
                	//postData.mineName = $("#search_mineName").val();
            		app.print(postData);
            	}else{
            		$.sticky("无打印数据，请先统计出报表，再打印！", {autoclose : 5000, position: "top-right", type: "st-error" });
            	}              
			});
			//列表-搜索操作
			$(".dt_searchs .btn").live('click',function (e) {
				e.preventDefault();
				var oSettings = app.oTable.fnSettings();
				var iCol,searchVal;
				
				$('body').data("search_startDate",$(".dt_searchs #search_startDate").val()).data("search_startTime",$(".dt_searchs #search_startTime").val()).data("search_endDate",$(".dt_searchs #search_endDate").val()).data("search_endTime",$(".dt_searchs #search_endTime").val());
				$('body').data("search_dateTime",$(".dt_searchs #search_date").val()).data("search_time",$(".dt_searchs #search_time").val());
				if($(".dt_searchs #search_startDate").val()!="" && $(".dt_searchs #search_endDate").val()!=""){
					$(".dt_searchs #search_rangeDate").val($(".dt_searchs #search_startDate").val()+" "+$(".dt_searchs #search_startTime").val()+","+$(".dt_searchs #search_endDate").val()+" "+$(".dt_searchs #search_endTime").val());
				}
				$(".dt_searchs #search_dateTime").val($(".dt_searchs #search_date").val()+" "+$(".dt_searchs #search_time").val());
				
   				$('.dt_searchs input[search-index]').each(function(){
  					searchVal = $(this).val();
  					iCol = $(this).attr("search-index"); 					
  					oSettings.aoPreSearchCols[ iCol ].sSearch = searchVal;
				});
				$('.dt_searchs select[search-index]').each(function(){
   					searchVal = $(this).val();
   					iCol = $(this).attr("search-index");
   					oSettings.aoPreSearchCols[ iCol ].sSearch = searchVal;
   				});
   				oSettings.selfRetrunZeroPage = true;
            	app.oTable.fnDraw(oSettings);            
			});			
			//详情-编辑按钮事件			
			$("#tab_view #editBtn").click(function(e){
				e.preventDefault();
				var data ={};
					data.id=$("#tab_view .doc_view").attr("msg-id");
				app.detailForEdit(data);
				$(this).tab('show');
			});
			//详情-删除按钮事件
			$("#tab_view #delteBtn").click(function(e){
				e.preventDefault();
	        	var postData = {};
	        	postData.ids = $("#tab_view .doc_view").attr("msg-id");
	        	app.del(postData);
	        	$(this).tab('show');
			});
			//增加-表单元素样式
			//1.人员选择
			$('#addForm select[name=users]').multiSelect({
				selectableHeader	: '<h4>待选人员</h4>',
				selectedHeader		: '<h4>已选人员</h4>'
			});
			$('.ms-optgroup .ms-selectable').find('li.ms-elem-selectable').hide();
			$('.ms-optgroup-label').click(function(){
				if ($(this).hasClass('ms-collapse')){
					$(this).nextAll('li').hide();
					$(this).removeClass('ms-collapse'); 
				} else {
					$(this).nextAll('li:not(.ms-selected)').show();
					$(this).addClass('ms-collapse');
				}
			});				
		},
		//================
		//列表行点击操作
		//================		
		rowLink: function() {
			$('*[data-msg_rowlink]').each(function () {
				var target = $(this).attr('data-msg_rowlink');			
				(this.nodeName == 'tr' ? $(this) : $(this).find('tr:has(td)')).each(function() {
				    var tr = $(this);
					var link = tr.find(target).first();
					if (!link.length) return;
					var href = link.attr('href');
					tr.find('td').not('.nohref').click(function() {
						var id = tr.find("td[msg_id]").attr("msg_id");
						var data ={};
							data.id=id;
						app.detailForRead(data);
						$(link).tab('show');
						$('.mbox .nav-tabs > .active').removeClass('active');					
					});
					link.replaceWith(link.html());
				});
			});
		},
		//================
		//加载数据详情操作
		//================		
		detailForRead:function(data){
			smoke.alert('数据加载中...',{ok:"取消"});
			data.random = Math.random();
			$.getJSON("json/listbox/detailForRead.json",data,function(msg){
				$("button[id^='alert-ok']").trigger('click');
				msg.id = data.id;
				ko.applyBindings(ko.mapping.fromJS(ko.toJS(msg)));
			});
		},
		//================
		//加载数据编辑操作
		//================			
		detailForEdit:function(data){
			smoke.alert('数据加载中...',{ok:"取消"});
			data.random = Math.random();
			$.getJSON("json/listbox/detailForEdit.json",data,function(msg){
				$("button[id^='alert-ok']").trigger('click');
				msg.id = data.id;
				msg.localeDatas = [{"value":"beijing","display":"北京"},{"value":"shanghai","display":"上海"},{"value":"guangzhou","display":"广州"},{"value":"shenzhen","display":"深圳"},{"value":"othercity","display":"其他城市"}];
				if("undefined" != typeof dynamicFormDatas){
					if(dynamicFormDatas.departmentDatas!=null){
						msg.departmentDatas = dynamicFormDatas.departmentDatas;
					}
					if(dynamicFormDatas.mineDatas!=null){
						msg.mineDatas = dynamicFormDatas.mineDatas;
					}
					if(dynamicFormDatas.roleDatas!=null){
						msg.roleDatas = dynamicFormDatas.roleDatas;
					}
				}
				var viewModel = ko.mapping.fromJS(ko.toJS(msg));
				ko.applyBindings(viewModel);
			});
		},
		//================
		//数据编辑提交操作
		//================			
		edit: function(form){
        	var postData = form.formSerialize();
        	$.ajax({
                    type : "post",
                    url : "listbox/edit.nut",
                    data : postData,
                    dataType : "json",
                    beforeSend : function(XMLHttpRequest){
                        form.find("input[type='submit']").addClass("disabled").removeClass("btn-gebo").val("处理中...");
                    },
                    success : function(msg,textStatus){
						form.find("input[type='submit']").removeClass("disabled").addClass("btn-gebo").val("提交");
						if(msg.state=="success"){
            				$.sticky("编辑成功!", {autoclose : 5000, position: "top-right", type: "st-success" });
           				 	//编辑成功后重绘DataTables
            				var oSettings = app.oTable.fnSettings();
            				//自定义变量，“true”重绘时候从第一页开始，“false”以当前页为准
            				oSettings.selfRetrunZeroPage = false;
            				app.oTable.fnDraw(oSettings);            			
            			}
                    },
                    error : function(XMLHttpRequest, textStatus, errorThrown){
                    	smoke.alert('服务器出错,请稍候再试',{ok:"取消"});
                    },
                    complete : function(XMLHttpRequest, textStatus){
                        form.clearForm();
                     	form.find("div").removeClass("f_success");   
                    }
         	}); 			
		},
		//================
		//数据增加提交操作
		//================		
        add: function(form) {
        	var postData = form.formSerialize();
        	$.ajax({
                    type : "post",
                    url : "listbox/add.nut",
                    data : postData,
                    dataType : "json",
                    beforeSend : function(XMLHttpRequest){
                        form.find("input[type='submit']").addClass("disabled").removeClass("btn-gebo").val("处理中...");
                    },
                    success : function(msg,textStatus){
						form.find("input[type='submit']").removeClass("disabled").addClass("btn-gebo").val("提交");
						if(msg.state=="success"){
            				$.sticky("新增成功!", {autoclose : 5000, position: "top-right", type: "st-success" });
            				//新增成功后重绘DataTables
            				var oSettings = app.oTable.fnSettings();
            				//自定义变量，“true”重绘时候从第一页开始，“false”以当前页为准
            				oSettings.selfRetrunZeroPage = false;
            				app.oTable.fnDraw(oSettings);             			
            			}
                    },
                    error : function(XMLHttpRequest, textStatus, errorThrown){
                    	smoke.alert('服务器出错,请稍候再试',{ok:"取消"});
                    },
                    complete : function(XMLHttpRequest, textStatus){
                        form.clearForm();
                     	form.find("div").removeClass("f_success");   
                    }
         	}); 
        },
		//================
		//数据删除提交操作
		//================        
        del : function(postData){
        	$.ajax({
                type : "post",
                url : "dataTables/doDelete.action",
                data : postData,
                dataType : "json",                  
                success : function(msg,textStatus){
					if(msg.state=="success"){
        				$.sticky("删除成功！", {autoclose : 5000, position: "top-right", type: "st-success" });
        				//把selectedIds中的id数据清空
        				app.selectedIds = new TAFFY();
        				//编辑成功后重绘DataTables
        				var oSettings = app.oTable.fnSettings();
        				//自定义变量，“true”重绘时候从第一页开始，“false”以当前页为准
        				oSettings.selfRetrunZeroPage = false;
        				app.oTable.fnDraw(oSettings);
        			}
                },
                error : function(XMLHttpRequest, textStatus, errorThrown){
                	smoke.alert('服务器出错，请稍候再试！',{ok:"取消"});
                }
        	});         	
        },
		//================
		//打印操作
		//================        
        print : function(postData){
            var urlStr = "pages/example/print/listbox.jsp?"+$.param(postData);
       		window.open(urlStr,'打印','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no, status=no');            
        },        
		//================
		//数据增加验证操作
		//================        
        regAdd: function() {
            var postForm = $("#addForm");
            postForm.find("#date").datepicker({language:'zh-CN',format:'yyyy-mm-dd'});
            reg_validator = postForm.validate({
				onkeyup: false,
				errorClass: 'error',
				validClass: 'valid',
				highlight: function(element) {
					$(element).closest('div').addClass("f_error");
				},
				unhighlight: function(element) {
					$(element).closest('div').removeClass("f_error");
				},
                errorPlacement: function(error, element) {
                    $(element).closest('div').append(error);
                },
                rules: {
					username: {required: true, rangelength:[6,12] },
					password: {required: true, rangelength:[6,20]},
					repassword: {required: true, equalTo:'#addForm #password'},
					workno: {required: true,remote:"listbox/validateWorkNo.nut"},
					age: {required: true, digits:true },
					gender: {required: true },
					email: {required: true, email:true },
					tel: {number:true },
					url: {url:true },
					date: {required: true, date:true },
					interest: {required: true },
					locale: {required: true },
					ipAddress: {ip:true},
					department: {required: true }
				},
                invalidHandler: function(form, validator) {
					$.sticky("表单中存在错误,请更正后提交!", {autoclose : 5000, position: "top-right", type: "st-error" });
				},
				submitHandler : function(form){
					app.add(postForm);
				},
				success: function(element) {
					$(element).closest('div').addClass("f_success");
	    		}
            })  	
      	},
		//================
		//数据编辑验证操作
		//================      	
      	regEdit: function() {
            var postForm = $("#editForm");
            postForm.find("#date").datepicker({language:'zh-CN',format:'yyyy-mm-dd'});
            reg_validator = postForm.validate({
				onkeyup: false,
				errorClass: 'error',
				validClass: 'valid',
				highlight: function(element) {
					$(element).closest('div').addClass("f_error");
				},
				unhighlight: function(element) {
					$(element).closest('div').removeClass("f_error");
				},
                errorPlacement: function(error, element) {
                    $(element).closest('div').append(error);
                },
                rules: {
					username: {required: true, rangelength:[6,12] },
					password: {required: true, rangelength:[6,20]},
					repassword: {required: true, equalTo:'#editForm #password'},
					workno: {required: true,
							 remote:{
								url: "listbox/validateWorkNo.nut",
								type: "post",
								dataType: "json",
								data: {
									workno: function() {
										return $("#editForm #workno").val();
									},
									id: function() {
										return $("#editForm #id").val();
									}
								}
						}},
					age: {required: true, digits:true },
					gender: {required: true },
					email: {required: true, email:true },
					tel: {number:true },
					url: {url:true },
					date: {required: true, date:true },
					interest: {required: true },
					locale: {required: true },
					department: {required: true }
				},
                invalidHandler: function(form, validator) {
					$.sticky("表单中存在错误,请更正后提交!", {autoclose : 5000, position: "top-right", type: "st-error" });
				},
				submitHandler : function(form){
					app.edit(postForm);
				},
				success: function(element) {
					$(element).closest('div').addClass("f_success");
	    		}
            })  	
      	},
		//================
		//权限管理操作
		//================      	
      	aclManage: function(acl){
      		if(acl.available!=null && acl.available=="true"){
      			if(acl.read==null || acl.read!="true"){
      				$("#mainTabs a[href='#tab_list']").hide();
      				$("#tab_list").hide();
      			}
      			if(acl.edit==null || acl.edit!="true"){
      				$("#editBtn").hide();
      			}
      			if(acl.del==null || acl.del!="true"){
      				$("#delteBtn").hide();
					$(".dt_tab_list_actions .delete_msg").hide();
      			}
      			if(acl.add==null || acl.add!="true"){
      				$("#mainTabs a[href='#tab_new']").hide();
      			}
      			if(acl.print==null || acl.print!="true"){
      				$(".dt_tab_list_actions .print").hide();
      			}
      		}else{
      			smoke.alert('对不起,您没有该模块权限',{ok:"关闭"},function(e){
      				window.location.href = "index.jsp";
      			});
      			$("#tab_list").hide();
      		}
      	},
		//================
		//创建表单中动态项
		//================       	
      	buildDynamicForm: function(data){
      		var departmentDatas = data.departmentDatas;
      		var mineDatas = data.mineDatas;
      		var roleDatas = data.roleDatas;
      		var dataTypeDatas = data.dataTypeDatas;
      		var userDatas = data.userDatas;
      		if(departmentDatas!=null){
				amplify.publish("buildSelectOption",$("#addForm #department"),departmentDatas);
      			amplify.publish("buildSelectOption",$(".dt_tab_list_searchs #department"),departmentDatas);      		
      		}
      		if(mineDatas!=null){
      			amplify.publish("buildSelectOption",$("#addForm #mine"),mineDatas);
      		}
      		if(roleDatas!=null){
      			amplify.publish("buildSelectOption",$("#addForm #role"),roleDatas);
      		}
      		if(roleDatas!=null){
      			amplify.publish("buildSelectOption",$("#addForm #dataType"),dataTypeDatas);
      		}
      		if(userDatas!=null){
      			amplify.publish("buildSelectOptionGroup",$("#addForm #optgroup"),userDatas);
      		}
      	},
		//================
		//创建搜索样式和数据
		//================       	
      	buildListSearchs: function(oSettings){
      		//* copy searchs to datatable
			$('#dt_tab_list_wrapper .dt_searchs').html($('.dt_tab_list_searchs').html());
			//* restore search input select
			
			$(".dt_searchs #search_startDate").val($('body').data("search_startDate"));
			$(".dt_searchs #search_startTime").val($('body').data("search_startTime"));
			$(".dt_searchs #search_endDate").val($('body').data("search_endDate"));
			$(".dt_searchs #search_endTime").val($('body').data("search_endTime"));
			$(".dt_searchs #search_date").val($('body').data("search_date"));
			$(".dt_searchs #search_time").val($('body').data("search_time"));
				
			$('.dt_searchs input[search-index]').each(function(){
    	  		iCol = $(this).attr("search-index");
    	  		if(oSettings.aoPreSearchCols[ iCol ] != null && oSettings.aoPreSearchCols[ iCol ].sSearch != null){
    	  			$(this).val(oSettings.aoPreSearchCols[ iCol ].sSearch);
    			}
    		});
   			$('.dt_searchs select[search-index]').each(function(){
   	   			iCol = $(this).attr("search-index");
   	   			if(oSettings.aoPreSearchCols[ iCol ] != null && oSettings.aoPreSearchCols[ iCol ].sSearch != null){
   	   				$(this).find("option[value='"+oSettings.aoPreSearchCols[ iCol ].sSearch+"']").attr("selected","selected");
   	   			}
   	   		});  
      		//* add control for input
      		//1.datapicker 
      		$("#dp_date").datepicker({language:'zh-CN',format:'yyyy-mm-dd'});

      		$('#dp_start').datepicker({language:'zh-CN',format: "yyyy-mm-dd"}).on('changeDate', function(ev){
				var dateText = $(this).data('date');
				var endDateTextBox = $('#dp_end input');
				if (endDateTextBox.val() != '') {
				var testStartDate = new Date(dateText);
				var testEndDate = new Date(endDateTextBox.val());
				if (testStartDate > testEndDate) {
						endDateTextBox.val(dateText);
					}
				}
				else {
					endDateTextBox.val(dateText);
				};
				var addDay =  moment(dateText).add('days',5).format("YYYY-MM-DD");
				$('#dp_end').datepicker('setEndDate', addDay);
				$('#dp_end').datepicker('setStartDate', dateText);
				$('#dp_start').datepicker('hide');
			});
			$('#dp_end').datepicker({language:'zh-CN',format: "yyyy-mm-dd"}).on('changeDate', function(ev){
				var dateText = $(this).data('date');
				var startDateTextBox = $('#dp_start input');
				if (startDateTextBox.val() != '') {
					var testStartDate = new Date(startDateTextBox.val());
					var testEndDate = new Date(dateText);
					if (testStartDate > testEndDate) {
						startDateTextBox.val(dateText);
					}
				}	
				else {
					startDateTextBox.val(dateText);
				};
				var subDay = moment(dateText).subtract('days',5).format("YYYY-MM-DD");
				$('#dp_start').datepicker('setStartDate', subDay);
				$('#dp_start').datepicker('setEndDate', dateText);
				$('#dp_end').datepicker('hide');
			});	
			//2.timepicker	 
			$('.dt_searchs #search_time').timepicker({
				defaultTime: 'value',
				minuteStep: 1,
				disableFocus: true,
				template: 'dropdown',
				showMeridian: false
			});
			$('.dt_searchs #search_startTime').timepicker({
				defaultTime: 'value',
				minuteStep: 1,
				disableFocus: true,
				template: 'dropdown',
				showMeridian: false
			}); 
			$('.dt_searchs #search_endTime').timepicker({
				defaultTime: 'value',
				minuteStep: 1,
				disableFocus: true,
				template: 'dropdown',
				showMeridian: false
			});  
      	}
    
    };				
</script>
		<script src="js/gebo_common.js"></script>		
	</body>
</html>